* Clean up

clear all

set maxvar 10000

/*
* Set working directory: please set your own
cd "/Users/vicentevalentim/Desktop/fragmentation_replication_bjps"
*/

* Open dataset
use Data/fragmentation_electionlevel, clear

set matsize 11000

* Create a local with the outcomes
local outcomes_with_pca turnout exec_bribery_corruption exec_embezzlement_theft ///
public_sector_corruption legislature_corruption percent_female_mps ///
repr_disadvantaged_groups power_distributed_by_gender power_distributed_sexorient ///
closeness_nextel vertical_acc_index ///
diagonal_acc_index public_goods ///
horizontal_acc_index gov_fract_index power_distr_socgroup ///
v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem ///
comp_underpriviliged comp_accountability comp_corruption comp_womenrep comp_summary

* A fake model just to create the dataset
regr year enppadd_bw50_tm1, cluster(country)
regsave enppadd_bw50_tm1 using Results/analyses.dta, ci level(95) replace tstat addlabel ///
(Outcome, fake, id, "Treatm status of closest parties", Polynomials, 1, Instruments, 1, Predictor, Absolute number parl parties, Sample, Whole, FE, Country fixed effects, Designator, 999999999)

	
*********************
* NAIVE REGRESSIONS *
*********************

foreach outcome in `outcomes_with_pca'{
	* ENPP
	regr `outcome'_stnd enpp, cluster(country)
	regsave enpp using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, " ", Polynomials,99, Instruments, 99, Model, OLS, Predictor, ENPP, Sample, Whole, FE, None)

	* Absolute number of parliamentary parties
	regr `outcome'_stnd cnt_parl_parties, cluster(country)
	regsave cnt_parl_parties using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, " ", Polynomials,99, Instruments, 99, Model, OLS, Predictor, ///
	Absolute number parl parties, Sample, Whole, FE, None)
}

* Generate a number to identify the iterations, so that then we can merge the ///
* file with results and the one with first stage f-statistic
local i = 1

* Generate an excel file for the first-stage statistics
putexcel set Results/firststage.xlsx, replace

foreach outcome in `outcomes_with_pca'{

	* ENPP
	* No fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) inbw50_below_tm1, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	None, Bandwidth, 50)	
	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country fixed effects, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Year fixed effects, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	

	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country and year fixed effects, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	


	
	* ABSOLUTE NUMBER OF PARTIES
	* No fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	None, Bandwidth, 50)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country fixed effects, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Year fixed effects, Bandwidth, 50)	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country and year fixed effects, Bandwidth, 50)	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	
	* 2SLS without fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_log_tm1) inbw50_below_tm1, cluster(country) 
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	None, Bandwidth, 50)	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* 2SLS with country fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_log_tm1) inbw50_below_tm1 i.country, cluster(country) 
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	Country fixed effects, Bandwidth, 50)	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* 2SLS with country and year fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_log_tm1)  inbw50_below_tm1 i.country i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	Country and year fixed effects, Bandwidth, 50)	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	** With Absolute number of parliamentary parties **
		
	* 2SLS without fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_log_tm1) inbw50_below_tm1, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	None, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* 2SLS with country fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_log_tm1) inbw50_below_tm1 i.country, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country fixed effects, Bandwidth, 50)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* 2SLS with country and year fixed effects, logged instrument
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_log_tm1) inbw50_below_tm1 i.country i.year, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel /// 
	(Outcome, `outcome', id, "No. parties just above (logged)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country and year fixed effects, Bandwidth, 50)

	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
	
	local ++i
	
	****************************************************************************
	******************* CONTROLLING FOR ALL NON-PARL PARTIES *******************
	****************************************************************************

	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) cnt_nonparl_parties_tm1, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above (controlling for all non-parl parties)", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	None, Bandwidth, 50)	

	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
	
	local ++i
	

	****************************************************************************
	********************** ANALYSES WITH OTHER ID STRATEGY *********************
	****************************************************************************

	** TOTAL NUMBER OF PARL PARTIES

	** ONE INSTRUMENT, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	perf_closest_party_3_norm_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1  ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1 perf_closest_party_3_norm_4_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	perf_closest_party_3_norm_tm1 ///
	perf_closest_party_4_norm_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1  ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	perf_closest_party_4_norm_3_tm1  ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1 perf_closest_party_3_norm_4_tm1 ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	perf_closest_party_4_norm_3_tm1 perf_closest_party_4_norm_4_tm1 ///
	  ///
	(partiesp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** EFFECTIVE NUMBER OF PARL PARTIES

	** ONE INSTRUMENT, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** ONE INSTRUMENT, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 1, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** TWO INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 2, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	perf_closest_party_3_norm_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1  ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** THREE INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1 perf_closest_party_3_norm_4_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 3, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	** FOUR INSTRUMENTS, ONE POLYNOMIAL
	
	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 ///
	perf_closest_party_2_norm_tm1 ///
	perf_closest_party_3_norm_tm1 ///
	perf_closest_party_4_norm_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,1, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, TWO POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,2, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, THREE POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1  ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	perf_closest_party_4_norm_3_tm1  ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,3, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	** FOUR INSTRUMENTS, FOUR POLYNOMIALS

	ivregress 2sls `outcome'_stnd perf_closest_party_1_norm_tm1 perf_closest_party_1_norm_sq_tm1 ///
	perf_closest_party_1_norm_3_tm1 perf_closest_party_1_norm_4_tm1 ///
	perf_closest_party_2_norm_tm1 perf_closest_party_2_norm_sq_tm1 ///
	perf_closest_party_2_norm_3_tm1 perf_closest_party_2_norm_4_tm1 ///
	perf_closest_party_3_norm_tm1 perf_closest_party_3_norm_sq_tm1 ///
	perf_closest_party_3_norm_3_tm1 perf_closest_party_3_norm_4_tm1 ///
	perf_closest_party_4_norm_tm1 perf_closest_party_4_norm_sq_tm1 ///
	perf_closest_party_4_norm_3_tm1 perf_closest_party_4_norm_4_tm1 ///
	  ///
	(enpp_tm1 = treated_closest_party_1_tm1 treated_closest_party_2_tm1 ///
	treated_closest_party_3_tm1 treated_closest_party_4_tm1), cluster(country)

	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "Treatm status of closest parties", Polynomials,4, Instruments, 4, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, None)
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
		}
	

********************************************************************************
********************************************************************************
************************* SUBSAMPLE ANALYSES ET AL *****************************
********************************************************************************
********************************************************************************


	****************************************************
	** ANALYSES INTERACTED WITH LEVEL OF POLARIZATION **
	****************************************************

	*******
	** Analyses split by the median level of polarization added by parties in the bandwidth
	*******

	***********************************************************
	** ANALYSES FOR ELECTIONS WITH POLARIZATION ABOVE MEDIAN **
	***********************************************************
	

foreach outcome in `outcomes_with_pca'{
	
	***********************************************************
	** ANALYSES FOR ELECTIONS WITH POLARIZATION ABOVE MEDIAN **
	***********************************************************
		
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if polarization_tm1 > polarization_tm1_median, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization above median, FE, None)
	
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	***********************************************************
	** ANALYSES FOR ELECTIONS WITH POLARIZATION BELOW MEDIAN **
	***********************************************************
	
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 inbw50_below_tm1 if polarization_tm1 < polarization_tm1_median, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization below median, FE, None)
	
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	*****************************************************************
	** ANALYSES FOR ELECTIONS WITH ADDED POLARIZATION ABOVE MEDIAN **
	*****************************************************************
		
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if poladd_bw50_tm1 > poladd_bw50_tm1_median, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization above median (added), FE, None)

	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	*****************************************************************
	** ANALYSES FOR ELECTIONS WITH ADDED POLARIZATION BELOW MEDIAN **
	*****************************************************************
	
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if poladd_bw50_tm1 < poladd_bw50_tm1_median, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization below median (added), FE, None)
	
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	*******
	** Analyses for specific percentiles of polarization
	*******
	
	* check values of polarization
	
	sum polarization_tm1, d
	
	** Polarization above 75% percentiles
	
	
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if polarization_tm1 > 1.947425, cluster(country)  
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization above 75 percentile, FE, None)
	
			estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	/*
	** Polarization above 90% percentiles

	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if polarization_tm1 > 2.457802, cluster(country)  
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Polarization above 90 percentile, FE, None)
	
	
		estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	*/
	***************************************************************************************
	************** ANALYSES DEPENDING ON PRE-TREATMENT LEVEL OF FRAGMENTATION *************
	***************************************************************************************

	*******
	** Analyses split by the median level of polarization added by parties in the bandwidth
	*******

	**************************************************************************
	** ANALYSES FOR ELECTIONS WITH PRE-TREATMENT FRAGMENTATION ABOVE MEDIAN **
	**************************************************************************
	
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if enpp_tm2 > enpp_tm2_median, cluster(country) 
	
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Fragmentation above median, FE, None)		

	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	
	**************************************************************************
	** ANALYSES FOR ELECTIONS WITH PRE-TREATMENT FRAGMENTATION BELOW MEDIAN **
	**************************************************************************
	
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if enpp_tm2 < enpp_tm2_median, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Fragmentation below median, FE, None)

	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

********************************************
** ANALYSES ONLY FOR HIGH THRESHOLDS ONLY **
********************************************

	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if threshold >=  median_threshold, cluster(country)  
	
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append tstat addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, 99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Threshold above median (4% of the vote), FE, None)

		estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	****************************************************************************
	******************* ANALYSES ONLY FOR EUROPEAN COUNTRIES *******************
	****************************************************************************

	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1 if european == 1, cluster(country)  
	
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, European countries, FE, None)

		estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	
}

* ANALYSES 5 YEARS AFTER TREATMENT
local outcomes_5 exec_bribery_corruption exec_embezzlement_theft public_sector_corruption  ///
legislature_corruption percent_female_mps ///
repr_disadvantaged_groups ///
power_distributed_by_gndr pwr_distributd_sexorient  ///
  vertical_acc_index diagonal_acc_index ///
horizontal_acc_index power_distr_socgroup public_goods ///
comp_underpriviliged comp_accountability comp_corruption comp_womenrep ///
v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem comp_summary


foreach outcome in `outcomes_5'{

	ivregress 2sls `outcome'_5_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Five Years After Treatment, FE, ///
	None)
	
		estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	}	
	
* ANALYSES 10 YEARS AFTER TREATMENT
local outcomes_10 exec_bribery_corruption exec_embezzlement_theft public_sector_corruption  ///
legislature_corruption percent_female_mps ///
repr_disadv_groups  ///
power_distributd_by_gndr pwr_distributd_sexorient  ///
 vertical_acc_index diagonal_acc_index ///
horizontal_acc_index power_distr_socgroup public_goods ///
comp_underpriviliged comp_accountability comp_corruption comp_womenrep ///
v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem comp_summary


foreach outcome in `outcomes_10'{

	ivregress 2sls `outcome'_10_stnd (partiesp_tm1 = inbw50_tm1) inbw50_below_tm1, cluster(country) 
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Ten Years After Treatment, FE, ///
	None)
	
		estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i

	
	}
	

** CHANGING THE BANDWIDTH		
** Bandwidths below 50

forvalues x = 10/49{
	foreach outcome in `outcomes_with_pca'{

	* ENPP
	* No fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	None, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Year fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	

	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country and year fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	


	
	* ABSOLUTE NUMBER OF PARTIES
	* No fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	None, Bandwidth, `x')
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Year fixed effects, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country and year fixed effects, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	}
}

** Bandwidths above 50
forvalues x = 51/100{
	foreach outcome in `outcomes_with_pca'{

	* ENPP
	* No fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, ///
	None, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Year fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	

	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw`x'_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave enpp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, ENPP, Sample, Whole, FE, Country and year fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	


	
	* ABSOLUTE NUMBER OF PARTIES
	* No fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	None, Bandwidth, `x')
		
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Country fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.country, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country fixed effects, Bandwidth, `x')
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i
	
	* Year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Year fixed effects, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	* Country and year fixed effects
	ivregress 2sls `outcome'_stnd (partiesp_tm1 = inbw`x'_tm1) inbw50_below_tm1 i.country i.year, cluster(country)
	regsave partiesp_tm1 using Results/analyses.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome', id, "No. parties just above", Polynomials, 99, Instruments, ///
	99, Model, 2SLS, Designator, `i', Predictor, Absolute number parl parties, Sample, Whole, FE, ///
	Country and year fixed effects, Bandwidth, `x')	
	
	estat first
			
	mat F = r(singleresults)
	local fstat =  F[1, 4]
		 
	putexcel A`i' = `i'
	putexcel B`i' = `fstat'	 
		 
	local ++i	
	
	}
}	

** BENCHMARKING EFFECTS **

* Check effect on share of female MPs, to benchmark
	ivregress 2sls percent_female_mps_stnd (enpp_tm1 = enppadd_bw50_tm1), cluster(country)
* Check effect on turnout, unstandardized, to benchmark
	ivregress 2sls turnout (enpp_tm1 = enppadd_bw50_tm1), cluster(country)


** FIRST STAGE AS A QUANTILE REGRESSION

use Data/fragmentation_electionlevel, clear

qreg partiesp_tm1 inbw50_tm1, quantile(0.1)
regsave inbw50_tm1 using Results/quantiles.dta, ci addlabel(Quantile, 0.1, OLS, 0) replace

forvalues x = 0.11(0.01)0.90{
qreg partiesp_tm1 inbw50_tm1, quantile(`x')
regsave inbw50_tm1 using Results/quantiles.dta, ci addlabel(Quantile, `x', OLS, 0) append
	
}

reg partiesp_tm1 inbw50_tm1
regsave inbw50_tm1 using Results/quantiles.dta,  ci addlabel(Quantile, 1, OLS, 1) append

********************************************************************************
******** Replicating main analyses using the data from Dinas et al 2015 ********
********************************************************************************

use Data/fragmentation_electionlevel_dinasonly.dta, clear

* Create a local with the outcomes we are using
local outcomes_with_pca turnout exec_bribery_corruption exec_embezzlement_theft ///
public_sector_corruption legislature_corruption percent_female_mps ///
repr_disadvantaged_groups power_distributed_by_gender power_distributed_sexorient ///
closeness_nextel vertical_acc_index ///
diagonal_acc_index public_goods ///
horizontal_acc_index gov_fract_index power_distr_socgroup ///
v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem ///
comp_underpriviliged comp_accountability comp_corruption comp_womenrep comp_summary

* A fake model just to create the dataset
regr year enppadd_bw50_tm1, cluster(country)
regsave enppadd_bw50_tm1 using Results/analyses_dinasonly.dta, ci level(95) replace tstat addlabel ///
(Outcome, fake)

foreach outcome in `outcomes_with_pca'{

	* ENPP
	* No fixed effects
	ivregress 2sls `outcome'_stnd (enpp_tm1 = enppadd_bw50_tm1) inbw50_below_tm1, cluster(country)
	regsave enpp_tm1 using Results/analyses_dinasonly.dta, ci level(95) append pval addlabel ///
	(Outcome, `outcome')	
}
